package demo1;

import entity.People;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-05-05
 * Time: 7:36
 */
@Component
public class PeopleCenter {
    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Bean
    public People getPeople() {
        People people = new People();
        people.setName("zhangsan");
        people.setAge(18);
        return people;
    }
}
